//
//  XMWXApiManager.h
//  XunMi
//
//  Created by MacBook on 2024/3/4.
//  Copyright © 2024 TieZhu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "XMShareModel.h"
#import <WXApi.h>


#define kWXApiManager [XMWXApiManager defaultManager]


NS_ASSUME_NONNULL_BEGIN

@protocol XMWXApiManagerDelegate <NSObject>
@optional
#pragma mark - 微信登陆
- (void)weChatLoginSuccess:(id)responseObject;
- (void)weChatLoginSuccessAuthResp:(SendAuthResp *)resp;

- (void)weChatLoginCancel;
- (void)weChatLoginFailed:(NSError *)error;

#pragma mark - 微信分享
- (void)weChatShareSuccess;
- (void)weChatShareCancel;
- (void)weChatShareFailed:(NSError *)error;

@end

@interface XMWXApiManager : NSObject <WXApiDelegate>
 
+ (instancetype)defaultManager;

@property (nonatomic, weak) id<XMWXApiManagerDelegate> delegate;

#pragma mark - 注册APPKEY
- (void)registerAppKey;

#pragma mark - 微信登陆
- (void)weChatLogin;

#pragma mark - 微信分享
- (void)weChatShare:(XMShareModel *)shareModel;

@end

NS_ASSUME_NONNULL_END
